#ifndef __3DSMODEL_H__
#define __3DSMODEL_H__
#include <map>
#include <vector>
#include "texture.h"
#include "Vec2f.h"
#include "Vec3f.h"
#include "Prerequisites.h"
#include "Singleton.h"
#include "Matrix4.h"
#include "AxisAlignedBox.h"
#include "ColorValue.h"
#include "mesh.h"


// This holds all the information for our model/scene. 
// You should eventually turn into a robust class that 
// has loading/drawing/querying functions like:
// LoadModel(...); DrawTarget(...); DrawModel(...); DestroyModel(...);
class RenderTarget 
{
	public:
		Mesh*			mMesh;				//Mesh data
        Texture*		mTexture;			//Texture data
		std::string		mName;				//Target name
		Matrix4			mMatrix;			//Transform info


	public:

		//默认构造函数
		RenderTarget() ;

		virtual ~RenderTarget() ;

		virtual void setPosition(float p_x, float p_y, float p_z);

		virtual void rotateTarget(float r_x, float r_y, float r_z);

		virtual void rotateTarget(const Vector3f& v);

		virtual void transTarget(float t_x, float t_y, float t_z);

		virtual void transTarget(const Vector3f& v);

		virtual void scaleTarget(float s_x, float s_y, float s_z);

		virtual void scaleTarget(const Vector3f& v);

		virtual void makeTransform(const Vector3f& position, const Vector3f& scale, const Quaternion& orientation);

        //绘制
        virtual void draw(void);

};

class TargetManager : public Singleton<TargetManager> {
	public:
		std::vector< RenderTarget* >    mTargetVec;

	public:
		TargetManager();

		void	importMesh(const char* model_path, const char* tex_path);

		void    importMeshFromIni(const char* ini_filename, const char* obj_name); 

		RenderTarget*	getTarget(size_t index);

		size_t	getTargetsCount(void) const;

		static TargetManager& getSingleton(void);

		static TargetManager* getSingletonPtr(void);

};

#endif//__3DSMODEL_H__
